﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Gl_mes.DAL.MesDB
{
    [Table("empl_info")]
    [Serializable]
    public class EmplInfo
    {
        /// <summary>
        /// ID，主键
        /// </summary>
        [Column("id")]
        [Key]
        [Required]
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        public int ID { get; set; }

        /// <summary>
        /// 产线ID
        /// </summary>
        [Column("line_id")]
        [Required]
        public int LineID { get; set; }


        /// <summary>
        /// 产线代号
        /// </summary>
        
        [Column("line_code")]
        [MaxLength(20)]
        public string LineCode { get; set; }

        /// <summary>
        /// 产线名称
        /// </summary>
        [Column("line_name")]
        [MaxLength(20)]
        public string LineName { get; set; }


        /// <summary>
        /// 产线组名
        /// </summary>
        [Column("cal_group_name")]
        [MaxLength(20)]
        public string CalGroupName { get; set; }

        /// <summary>
        /// 工号
        /// </summary>
        [Column("empl_number")]
        [Required]
        [MaxLength(20)]
        public string EmplNumber { get; set; }

        /// <summary>
        /// 员工姓名
        /// </summary>
        [Column("empl_name")]
        [Required]
        [MaxLength(20)]
        public string EmplName { get; set; }

        /// <summary>
        /// 部门代号
        /// </summary>
        [Column("dept_code")]
        [MaxLength(20)]
        public string DeptCode { get; set; }

        /// <summary>
        /// 部门名称
        /// </summary>
        [Column("dept_name")]
        [MaxLength(50)]
        public string DeptName { get; set; }

        /// <summary>
        /// 性别，1代表女，0代表男
        /// </summary>
        [Column("sex")]
        [Required]
        public int Sex { get; set; }

        /// <summary>
        /// 地址
        /// </summary>
        [Column("addr")]
        [MaxLength(50)]
        public string Address { get; set; }

        /// <summary>
        /// 联系电话
        /// </summary>
        [Column("phone")]
        [MaxLength(20)]
        public string Phone { get; set; }


        /// <summary>
        /// 是否离职，1代表离职，0代表未离职
        /// </summary>
        [Column("is_del")]
        [Required]
        public int IsDel { get; set; }

        /// <summary>
        /// 离职日期
        /// </summary>
        [Column("del_date")]
        public DateTime? DelDate { get; set; }

        /// <summary>
        /// 建档人
        /// </summary>
        [Column("create_user")]
        [Required]
        [MaxLength(20)]
        public string CreateUser { get; set; }

        /// <summary>
        /// 建档日期
        /// </summary>
        [Column("create_date")]
        [Required]
        public DateTime CreateDate { get; set; }


        /// <summary>
        /// 更新人
        /// </summary>
        [Column("update_user")]
        [MaxLength(20)]
        public string UpdateUser { get; set; }

        /// <summary>
        /// 更新日期
        /// </summary>
        [Column("update_date")]
        public DateTime? UpdateDate { get; set; }

        /// <summary>
        /// 员工状态
        /// </summary>
        [NotMapped]
        public string EmplState { get; set; }
    }
}
